
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<title>委托逐月</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="../../../js/angular.js"></script>
<link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
<script type="text/javascript" src="../../../layui/lay/modules/layer.js"></script>
<script src="../../../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
<script src="../../../layui/layui.js" charset="utf-8"></script>
</head>
<style>
         .layui-form-label{
         	 text-align: left;
             width:130px;
             height:30px;

     }
</style>
</head>


<body>
	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 20px;">
		<legend>委托逐月</legend> 
	</fieldset>

    <div ng-app="myApp" ng-controller="customersCtrl" align="center">
		<div class="layui-form-item">
			<div class="layui-inline" >
				<label class="layui-form-label">姓名:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="XM" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">证件号码:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="ZJHM" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">联系电话:</label>
				<div class="layui-input-inline" >
					<input type="text" ng-model="DH" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
		    <div class="layui-inline" >
				<label class="layui-form-label">个人账号:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="GRZH" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
			<div class="layui-inline" >
				<label class="layui-form-label">缴存银行:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="JCYH" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
			<div class="layui-inline" >
				<label class="layui-form-label">月缴存额:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="JCJE" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline" >
				<label class="layui-form-label" >申请借款金额 :</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="SQJKJE" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label" >申请借款年限:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="SQJKQX" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label">缴存情况:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="JCQK" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
		     <div class="layui-inline" >
				<label class="layui-form-label" >个人缴存余额:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="GRJCYE" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
			<div class="layui-inline" >
				<label class="layui-form-label">单位名称:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="DWMC" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
			<div class="layui-inline" >
				<label class="layui-form-label">单位代码:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="DWDM" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
		</div>
		<fieldset class="layui-elem-field layui-field-title"
			style="margin-top: 30px;"></fieldset>
		<div class="layui-form-item" style="">
		    <div class="layui-inline" >
				<label class="layui-form-label">还款人姓名:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="HKRXM" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
			</div>
			<div class="layui-inline" >
				<label class="layui-form-label">月还款额:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="YHKE" autocomplete="off"
						class="layui-input" readonly="readonly">
		        </div>
		    </div>
		    <div class="layui-inline">
				<label class="layui-form-label">委托银行:</label>
				<div class="layui-input-inline">
					<input type="text" ng-model="WTYH" autocomplete="off"
						class="layui-input" readonly="readonly">
				</div>
	       	</div>
		  </div>
			<div class="layui-form-item">
				<div class="layui-inline" >
					<label class="layui-form-label" >还款起始日期:</label>
					<div class="layui-input-inline">
						<input type="text" id="start"  autocomplete="off"
							class="layui-input" readonly="true">
					</div>
				</div>
			<div class="layui-inline" >
				<label class="layui-form-label">委托年限:</label>
				<div class="layui-input-inline">
				<select id="end" ng-model="selected" ng-change="change()" style="width:100%;height:35px;">
				<option ng-repeat="x in nums" value="{{x.num}}">{{x.year}}</option>
			   </select>
		        </div>
		    </div>
				<div class="layui-inline">
					<label class="layui-form-label" >还款中止日期:</label>
					<div class="layui-input-inline">
						<input type="text" ng-model="HKZZRQ" readonly autocomplete="off"
							class="layui-input" id="zzrq">
					</div>
				</div>
			  </div>
		      <div class="layui-input-block">
					<button class="layui-btn"  ng-click="tj()">提交</button>
					<button type="reset" class="layui-btn layui-btn-primary"
						ng-click="cz()">重置</button>
	          </div>
	   
</div>
	<script type="text/javascript">
	  function getPath(){
		  return 'http://'+location.host;	
		      };
		 var app = angular.module('myApp', []);
		 app.controller('customersCtrl', function($scope, $http) {
		         $scope.nums = [
                 {year : "1年", num : "1"},
                 {year : "2年", num : "2"},
                 {year : "3年", num : "3"}
                  ];
                  $scope.change=function(){
                      /* 获取时间控件选定的值 */
			          var qsrq=document.getElementById("start").value;
			          /* 获取点击的值 */
                      var djtonum=parseInt($scope.selected);
                      /* 取出年  月 日*/
                       var aa = new Date(qsrq);
                       aa.setFullYear(aa.getFullYear()+djtonum);
                       var newdate=aa.toLocaleDateString();
                       $scope.HKZZRQ=newdate;
                       $scope.HKQSRQ=qsrq;
                  };
			     $http({
					url : getPath() + "/wsyyt/wtzycontroller/test",
					contentType : "text/html;charset=utf-8",
					method : 'post',
				}).then(function(res) {
				   if(res.data.code==1){
				       layer.msg('提示：'+res.data.CW,{icon: 5});
				   }
				   $scope.XM=res.data.data[0].XINGMING;
				   $scope.HKRXM=res.data.data[0].XINGMING;
				   $scope.ZJHM=res.data.data[0].ZJHM;
				   $scope.DH=res.data.data[0].DH;
				   $scope.GRZH=res.data.data[0].GRZH;
				   $scope.JCYH=res.data.data[0].JCYH;
				   $scope.WTYH=res.data.data[0].WTYH;
				   $scope.JCJE=res.data.data[0].JCJE;
				   $scope.JCQK=res.data.data[0].JCQK;
				   $scope.DWDM=res.data.data[0].DWZH;
				   $scope.DWMC=res.data.data[0].DWMC;
				   $scope.SQJKJE=res.data.data[0].SQJKJE;
				   $scope.SQJKQX=res.data.data[0].SQJKQX;
				   $scope.GRJCYE=res.data.data[0].YE;
				   $scope.YHKE=res.data.data[0].YHKE;
	      /** 提交申请function */
			$scope.tj = function() {
				$scope.params = {
				   xm:$scope.XM,
				   wtyh : $scope.WTYH,
				   hkqsrq:$scope.HKQSRQ,
				   hkzzrq:$scope.HKZZRQ,
				   gsdqdm:res.data.data[0].GSDQDM,
				   dqdm:res.data.data[0].DQDM,
				   dkzh:res.data.data[0].DKZH,
				   dwmc:res.data.data[0].DWMC,
				   dwzh:res.data.data[0].DWZH,
				   htbh:res.data.data[0].HTBH,
				   dh:res.data.data[0].DH,
				   zjhm:res.data.data[0].ZJHM,
				   WTYH:res.data.data[0].WTYH,
				   jcyh:res.data.data[0].JCYH,
				   yjce:res.data.data[0].JCJE,
				   grzh:res.data.data[0].GRZH,
				   ye:res.data.data[0].YE,
				};
				$http({
					url : getPath() + "/wsyyt/wtzycontroller/test1",
					contentType : "text/html;charset=utf-8",
					method : 'post',
					params : $scope.params,
				}).then(function(res) {
				   $scope.code=res.data.code;
		           if($scope.code==0){
		   				layer.msg('提示：申请成功,等待审核.....',{icon: 5});
					}else{
		  				layer.msg('提示：'+res.data.CW,{icon: 5});
					}
				});
			  };
			  /**重置function  */
			  $scope.cz=function(){
			    $scope.WTYH="";
				$scope.HKQSRQ="";
				$scope.HKZZRQ="";
			  };
			});
		});
	</script>
	 <script>
layui.use(['form', 'layedit', 'laydate'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
  
 laydate.render({
    elem: '#start',
    format: 'yyyy/MM/dd',
   done: function(value, date, endDate){
    			var qsrq=document.getElementById("start").value;
			          /* 获取点击的值 */
                   var options=$("#end option:selected");  //获取选中的项
					var nx=parseInt(options.val());
					 var aa = new Date(qsrq);
                       aa.setFullYear(aa.getFullYear()+nx);
                          var newdate=aa.toLocaleDateString();
                          $("#zzrq").val(newdate);
	  }
    
  });

});

</script>

</body>
</html>